import { createRouter, createWebHistory,RouteRecordRaw } from "vue-router"
import Layout from "@/components/layout/index.vue"
import Menu from "@/view/system/menu.vue"
import User from "@/view/system/User.vue"
import Org from "@/view/system/Org.vue"
import Role from "@/view/system/Role.vue"
import Login from "@/view/Login.vue"
import Home from '@/view/Home.vue'
import Community from '@/view/Community.vue'

const routes:Array<RouteRecordRaw> = [
    {
        path: '/',
        redirect: '/login'
    },
    {
        path: '/login',
        component: Login
    },
    {
        path: '/home',
        component: Layout,
        redirect: '/home',
        children: [
            {
                path: '/home',
                component: Home
            },
            {
                path: '/community',
                component: Community
            },
            {
                path: '/menu1',
                component: Menu
            },
            {
                path: '/menu2',
                component: Org
            },
            {
                path: '/menu3',
                component: User
            },
            {
                path: '/menu41',
                component: Role
            },
            {
                path: '/menu42',
                component: User
            },
            {
                path: '/menu43',
                component: Menu
            },
            {
                path: '/org',
                component: Org
            },
            {
                path: '/menu',
                component: Menu
            },
            {
                path: '/role',
                component: Role
            },
            {
                path: '/user',
                component: User
            }
        ]
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes
})
export default router